import request from './request.js'
import configs from './configs'

const baseURL = configs.API_BASE_URL

// 文件-上传
export const upload = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/file/upload`,
		data
	})
}

//逆向获取位置
export const regeo = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/regeo`,
		data
	})
}

// 订单列表-转单
export const transferOrder = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/order/transfer?sn=${data.sn}`,
		data
	})
}
// 订单列表-开始服务
export const startOrder = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/order/start`,
		data
	})
}
// 订单列表-接单
export const receiveOrder = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/order/receiving?sn=${data.sn}`,
		data
	})
}
// 订单列表-结束服务
export const finishOrder = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/order/finished`,
		data
	})
}
// 订单列表-任务工单
export const orderlist = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/orders`,
		data
	})
}
// 订单列表-历史订单
export const historylist = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/order/history`,
		data
	})
}
// 订单列表-接单中心
export const orderTask = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/order/task`,
		data
	})
}
// 订单列表-订单详情
export const orderDetail = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/order/detail`,
		data
	})
}

// login-controller
export const bindAppid = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/bind/${data.appid}?code=${data.code}`,
		data
	})
}
export const updateStaff = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/update`,
		data
	})
}
export const addStaff = (data) => {
  return request({
		baseURL,
		method: 'GET',
		url: `/staff/add`,
		data
	})
}
export const isLogin = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/isLogin`,
		data
	})
}
export const getUserInfo = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/getUserInfo`,
		data
	})
}
export const doLogin = (data) => {
  return request({
		baseURL,
		method: 'POST',
		url: `/staff/doLogin?username=${data.username}&password=${data.password}`,
		data
	})
}